home *** CD-ROM | disk | FTP | other *** search
/ APDL Eductation Resources / APDL Eductation Resources.iso / programs / astronomy / skyview / !SkyView / h / datime next >
Encoding:
Text File  |  1992-09-10  |  3.4 KB  |  83 lines

  1. /********************************************************/
  2. /*                        datime.h                      */
  3. /* Header file for sundry utility functions concerning  */
  4. /*                     date and time.                   */
  5. /********************************************************/
  6.  
  7. /*-------------------- datime_hourmin --------------------
  8.  * Description: Converts time of day in hours into integer
  9.  *              hours and minutes.
  10.  *
  11.  * Parameters:  REAL time    -- time of day in hours.
  12.  *              int *hourptr -- integer to fill in with
  13.  *                              number of hours.
  14.  *              int *minptr  -- integer to fill in with
  15.  *                              number of minutes.
  16.  * Returns:     void.
  17.  * Other info:  'time' must be in the range
  18.  *              0 <= time < 24.0
  19.  */
  20.  
  21.   void datime_hourmin(REAL time, int *hourptr, int *minptr);
  22.  
  23.  
  24. /*--------------------- datime_julian --------------------
  25.  * Description: Calculates the number of days (and fraction of a
  26.  *              day) from noon GMT on 00/01/1900 to the specified
  27.  *              date and time.
  28.  *
  29.  * Parameters:  observerstr *ptr -- pointer to the observerstr
  30.  *                                  containing the required date
  31.  *                                  & the time offset (time zone).
  32.  *              int hour         -- the required time (hour part).
  33.  *              int min          -- the required time (min part).
  34.  *
  35.  * Returns:     Calculated no. of days.
  36.  * Other info:  The following fields in the specified observerstr
  37.  *              must be valid: year, month, day, offset.
  38.  */
  39.  
  40. double datime_julian(observerstr *ptr, int hour, int min);
  41.  
  42.  
  43. /*-------------------- datime_siderial -------------------
  44.  * Description: Calculates the local siderial time corresponding
  45.  *              to the specified date and time.
  46.  *
  47.  * Parameters:  observerstr *ptr -- pointer to the observerstr con-
  48.  *                                  taining input data.
  49.  *              double jul   -- No. of days from noon GMT 0/1/1900
  50.  *                              to required date and time.
  51.  *              int hour     -- the required time (hour part).
  52.  *              int min      -- the required time (min part).
  53.  *
  54.  * Returns:     Local siderial time, in radians.  Range is
  55.  *              0 <= time < 2*PI.
  56.  * Other info:  The following fields in the specified observerstr
  57.  *              must be valid: offset, longit.
  58.  */
  59.  
  60. REAL datime_siderial(observerstr *ptr, double jul, int hour, int min);
  61.  
  62.  
  63. /*------------------- datime_time_today ------------------
  64.  * Description: Calculates (one) civil time during the day at which
  65.  *              the Local Siderial Time is equal to the value given.
  66.  *
  67.  * Parameters:  REAL sid_time    -- the required local siderial time,
  68.  *                                  in radians.
  69.  *              observerstr *ptr -- pointer to the observerstr con-
  70.  *                                  taining details of the relationship
  71.  *                                  between civil and local siderial time.
  72.  *              int *hourptr     -- pointer to int to fill in with
  73.  *                                  hour.
  74.  *              int *minptr      -- pointer to int to fill in with
  75.  *                                  minute.
  76.  * Returns:     void.
  77.  * Other info:  The sid field in the observerstr must correspond
  78.  *              with the hour and min fields.
  79.  */
  80.  
  81. void datime_time_today(REAL sid_time, observerstr *ptr,
  82.                        int *hourptr, int *minptr);
  83.